var util = require("../../../utils/util.js"),
  api = require("../../../utils/api.js"),
  app = getApp();
Page({
  data: {
    pageIndex: 1,
    pageSize: 10,
    dataList: [],
    active: 0,
    playStatusNum: 0,
    ordernum: '',
    serverid: 0,
    uclatid: '',
    showEmpty:false,
    proScroll:false
  },
  onLoad: function (t) {
    this.setData({
      ordernum: t.ordernum,
      serverid: t.serverid,
      uclatid: t.uclatid,
    });
    this.getProcessfile();
  },
  async getProcessfile() {
    const {pageIndex,pageSize,ordernum,serverid,uclatid,dataList}=this.data;
    let parms = {pageIndex,pageSize,ordernum,serverid,uclatid}
    let {
      data
    } = await api.default.myInclaimantProcess(parms);
    let listArr = Array.isArray(data.list) ? data.list : [];
    this.setData({
      proScroll: listArr.length < pageSize ? true : false,
      dataList: pageIndex == 1 ? listArr : [...dataList, ...listArr],
      showEmpty: data.total == 0 ? true : false,
    })
  },
  copyMethod(e) {
    const {
      fileurl
    } = e.currentTarget.dataset;
    wx.setClipboardData({
      data: fileurl,
      success: function () {
        wx.showToast({
          title: '链接已复制',
          icon: 'success',
          duration: 2000
        })
      }
    })
  },
  onReachBottom() {
    if (!this.data.proScroll) {
      let page = this.data.pageIndex;
      page = page + 1;
      this.setData({
        pageIndex: page
      })
      this.getAppointRecords();
    }
  },
});